From: Carlos Soriano Date: Fri, 23 Aug 2013 18:49:27 +0000 (+0200) Subject: appDisplay: Add pan action to FolderView X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3536 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1e02081cd228a5edb9741b6f8d7081f85d2ca047;p=gnome-shell.git appDisplay: Add pan action to FolderView Since we have now a ScrollView in the FolderView, add support for the pan action https://bugzilla.gnome.org/show_bug.cgi?id=706081 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index bef866e3d..59ca49727 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -884,6 +884,10 @@ const FolderView = new Lang.Class({ let scrollableContainer = new St.BoxLayout({ vertical: true, reactive: true }); scrollableContainer.add_actor(this._grid.actor); this.actor.add_actor(scrollableContainer); + + let action = new Clutter.PanAction({ interpolate: true }); + action.connect('pan', Lang.bind(this, this._onPan)); + this.actor.add_action(action); }, _getItemId: function(item) { @@ -921,6 +925,13 @@ const FolderView = new Lang.Class({ return icon; }, + _onPan: function(action) { + let [dist, dx, dy] = action.get_motion_delta(0); + let adjustment = this.actor.vscroll.adjustment; + adjustment.value -= (dy / this.actor.height) * adjustment.page_size; + return false; + }, + adaptToSize: function(width, height) { this._parentAvailableWidth = width; this._parentAvailableHeight = height;